{"ast":null,"code":"import _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport * as React from 'react';\nimport warning from '../../../_util/warning';\nimport { getColumnKey, getColumnPos, renderColumnTitle } from '../../util';\nimport FilterDropdown from './FilterDropdown';\nfunction collectFilterStates(columns, init, pos) {\n  var filterStates = [];\n  (columns || []).forEach(function (column, index) {\n    var _a;\n    var columnPos = getColumnPos(index, pos);\n    if (column.filters || 'filterDropdown' in column || 'onFilter' in column) {\n      if ('filteredValue' in column) {\n        // Controlled\n        var filteredValues = column.filteredValue;\n        if (!('filterDropdown' in column)) {\n          filteredValues = (_a = filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.map(String)) !== null && _a !== void 0 ? _a : filteredValues;\n        }\n        filterStates.push({\n          column: column,\n          key: getColumnKey(column, columnPos),\n          filteredKeys: filteredValues,\n          forceFiltered: column.filtered\n        });\n      } else {\n        // Uncontrolled\n        filterStates.push({\n          column: column,\n          key: getColumnKey(column, columnPos),\n          filteredKeys: init && column.defaultFilteredValue ? column.defaultFilteredValue : undefined,\n          forceFiltered: column.filtered\n        });\n      }\n    }\n    if ('children' in column) {\n      filterStates = [].concat(_toConsumableArray(filterStates), _toConsumableArray(collectFilterStates(column.children, init, columnPos)));\n    }\n  });\n  return filterStates;\n}\nfunction injectFilter(prefixCls, dropdownPrefixCls, columns, filterStates, triggerFilter, getPopupContainer, locale, pos) {\n  return columns.map(function (column, index) {\n    var columnPos = getColumnPos(index, pos);\n    var _column$filterMultipl = column.filterMultiple,\n      filterMultiple = _column$filterMultipl === void 0 ? true : _column$filterMultipl,\n      filterMode = column.filterMode,\n      filterSearch = column.filterSearch;\n    var newColumn = column;\n    if (newColumn.filters || newColumn.filterDropdown) {\n      var columnKey = getColumnKey(newColumn, columnPos);\n      var filterState = filterStates.find(function (_ref) {\n        var key = _ref.key;\n        return columnKey === key;\n      });\n      newColumn = Object.assign(Object.assign({}, newColumn), {\n        title: function title(renderProps) {\n          return /*#__PURE__*/React.createElement(FilterDropdown, {\n            tablePrefixCls: prefixCls,\n            prefixCls: \"\".concat(prefixCls, \"-filter\"),\n            dropdownPrefixCls: dropdownPrefixCls,\n            column: newColumn,\n            columnKey: columnKey,\n            filterState: filterState,\n            filterMultiple: filterMultiple,\n            filterMode: filterMode,\n            filterSearch: filterSearch,\n            triggerFilter: triggerFilter,\n            locale: locale,\n            getPopupContainer: getPopupContainer\n          }, renderColumnTitle(column.title, renderProps));\n        }\n      });\n    }\n    if ('children' in newColumn) {\n      newColumn = Object.assign(Object.assign({}, newColumn), {\n        children: injectFilter(prefixCls, dropdownPrefixCls, newColumn.children, filterStates, triggerFilter, getPopupContainer, locale, columnPos)\n      });\n    }\n    return newColumn;\n  });\n}\nexport function flattenKeys(filters) {\n  var keys = [];\n  (filters || []).forEach(function (_ref2) {\n    var value = _ref2.value,\n      children = _ref2.children;\n    keys.push(value);\n    if (children) {\n      keys = [].concat(_toConsumableArray(keys), _toConsumableArray(flattenKeys(children)));\n    }\n  });\n  return keys;\n}\nfunction generateFilterInfo(filterStates) {\n  var currentFilters = {};\n  filterStates.forEach(function (_ref3) {\n    var key = _ref3.key,\n      filteredKeys = _ref3.filteredKeys,\n      column = _ref3.column;\n    var filters = column.filters,\n      filterDropdown = column.filterDropdown;\n    if (filterDropdown) {\n      currentFilters[key] = filteredKeys || null;\n    } else if (Array.isArray(filteredKeys)) {\n      var keys = flattenKeys(filters);\n      currentFilters[key] = keys.filter(function (originKey) {\n        return filteredKeys.includes(String(originKey));\n      });\n    } else {\n      currentFilters[key] = null;\n    }\n  });\n  return currentFilters;\n}\nexport function getFilterData(data, filterStates) {\n  return filterStates.reduce(function (currentData, filterState) {\n    var _filterState$column = filterState.column,\n      onFilter = _filterState$column.onFilter,\n      filters = _filterState$column.filters,\n      filteredKeys = filterState.filteredKeys;\n    if (onFilter && filteredKeys && filteredKeys.length) {\n      return currentData.filter(function (record) {\n        return filteredKeys.some(function (key) {\n          var keys = flattenKeys(filters);\n          var keyIndex = keys.findIndex(function (k) {\n            return String(k) === String(key);\n          });\n          var realKey = keyIndex !== -1 ? keys[keyIndex] : key;\n          return onFilter(realKey, record);\n        });\n      });\n    }\n    return currentData;\n  }, data);\n}\nfunction useFilter(_ref4) {\n  var prefixCls = _ref4.prefixCls,\n    dropdownPrefixCls = _ref4.dropdownPrefixCls,\n    mergedColumns = _ref4.mergedColumns,\n    onFilterChange = _ref4.onFilterChange,\n    getPopupContainer = _ref4.getPopupContainer,\n    tableLocale = _ref4.locale;\n  var _React$useState = React.useState(function () {\n      return collectFilterStates(mergedColumns, true);\n    }),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    filterStates = _React$useState2[0],\n    setFilterStates = _React$useState2[1];\n  var mergedFilterStates = React.useMemo(function () {\n    var collectedStates = collectFilterStates(mergedColumns, false);\n    if (collectedStates.length === 0) {\n      return collectedStates;\n    }\n    var filteredKeysIsAllNotControlled = true;\n    var filteredKeysIsAllControlled = true;\n    collectedStates.forEach(function (_ref5) {\n      var filteredKeys = _ref5.filteredKeys;\n      if (filteredKeys !== undefined) {\n        filteredKeysIsAllNotControlled = false;\n      } else {\n        filteredKeysIsAllControlled = false;\n      }\n    });\n    // Return if not controlled\n    if (filteredKeysIsAllNotControlled) {\n      // Filter column may have been removed\n      var keyList = (mergedColumns || []).map(function (column, index) {\n        return getColumnKey(column, getColumnPos(index));\n      });\n      return filterStates.filter(function (_ref6) {\n        var key = _ref6.key;\n        return keyList.includes(key);\n      }).map(function (item) {\n        var col = mergedColumns[keyList.findIndex(function (key) {\n          return key === item.key;\n        })];\n        return Object.assign(Object.assign({}, item), {\n          column: Object.assign(Object.assign({}, item.column), col),\n          forceFiltered: col.filtered\n        });\n      });\n    }\n    process.env.NODE_ENV !== \"production\" ? warning(filteredKeysIsAllControlled, 'Table', 'Columns should all contain `filteredValue` or not contain `filteredValue`.') : void 0;\n    return collectedStates;\n  }, [mergedColumns, filterStates]);\n  var filters = React.useMemo(function () {\n    return generateFilterInfo(mergedFilterStates);\n  }, [mergedFilterStates]);\n  var triggerFilter = function triggerFilter(filterState) {\n    var newFilterStates = mergedFilterStates.filter(function (_ref7) {\n      var key = _ref7.key;\n      return key !== filterState.key;\n    });\n    newFilterStates.push(filterState);\n    setFilterStates(newFilterStates);\n    onFilterChange(generateFilterInfo(newFilterStates), newFilterStates);\n  };\n  var transformColumns = function transformColumns(innerColumns) {\n    return injectFilter(prefixCls, dropdownPrefixCls, innerColumns, mergedFilterStates, triggerFilter, getPopupContainer, tableLocale);\n  };\n  return [transformColumns, mergedFilterStates, filters];\n}\nexport default useFilter;","map":{"version":3,"names":["_toConsumableArray","React","warning","getColumnKey","getColumnPos","renderColumnTitle","FilterDropdown","collectFilterStates","columns","init","pos","filterStates","forEach","column","index","_a","columnPos","filters","filteredValues","filteredValue","map","String","push","key","filteredKeys","forceFiltered","filtered","defaultFilteredValue","undefined","concat","children","injectFilter","prefixCls","dropdownPrefixCls","triggerFilter","getPopupContainer","locale","filterMultiple","filterMode","filterSearch","newColumn","filterDropdown","columnKey","filterState","find","_ref","Object","assign","title","renderProps","createElement","tablePrefixCls","flattenKeys","keys","_ref2","value","generateFilterInfo","currentFilters","_ref3","Array","isArray","filter","originKey","includes","getFilterData","data","reduce","currentData","onFilter","length","record","some","keyIndex","findIndex","k","realKey","useFilter","_ref4","mergedColumns","onFilterChange","tableLocale","useState","setFilterStates","mergedFilterStates","useMemo","collectedStates","filteredKeysIsAllNotControlled","filteredKeysIsAllControlled","_ref5","keyList","_ref6","item","col","process","env","NODE_ENV","newFilterStates","_ref7","transformColumns","innerColumns"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/table/hooks/useFilter/index.js"],"sourcesContent":["import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport * as React from 'react';\nimport warning from '../../../_util/warning';\nimport { getColumnKey, getColumnPos, renderColumnTitle } from '../../util';\nimport FilterDropdown from './FilterDropdown';\nfunction collectFilterStates(columns, init, pos) {\n  let filterStates = [];\n  (columns || []).forEach((column, index) => {\n    var _a;\n    const columnPos = getColumnPos(index, pos);\n    if (column.filters || 'filterDropdown' in column || 'onFilter' in column) {\n      if ('filteredValue' in column) {\n        // Controlled\n        let filteredValues = column.filteredValue;\n        if (!('filterDropdown' in column)) {\n          filteredValues = (_a = filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.map(String)) !== null && _a !== void 0 ? _a : filteredValues;\n        }\n        filterStates.push({\n          column,\n          key: getColumnKey(column, columnPos),\n          filteredKeys: filteredValues,\n          forceFiltered: column.filtered\n        });\n      } else {\n        // Uncontrolled\n        filterStates.push({\n          column,\n          key: getColumnKey(column, columnPos),\n          filteredKeys: init && column.defaultFilteredValue ? column.defaultFilteredValue : undefined,\n          forceFiltered: column.filtered\n        });\n      }\n    }\n    if ('children' in column) {\n      filterStates = [].concat(_toConsumableArray(filterStates), _toConsumableArray(collectFilterStates(column.children, init, columnPos)));\n    }\n  });\n  return filterStates;\n}\nfunction injectFilter(prefixCls, dropdownPrefixCls, columns, filterStates, triggerFilter, getPopupContainer, locale, pos) {\n  return columns.map((column, index) => {\n    const columnPos = getColumnPos(index, pos);\n    const {\n      filterMultiple = true,\n      filterMode,\n      filterSearch\n    } = column;\n    let newColumn = column;\n    if (newColumn.filters || newColumn.filterDropdown) {\n      const columnKey = getColumnKey(newColumn, columnPos);\n      const filterState = filterStates.find(_ref => {\n        let {\n          key\n        } = _ref;\n        return columnKey === key;\n      });\n      newColumn = Object.assign(Object.assign({}, newColumn), {\n        title: renderProps => /*#__PURE__*/React.createElement(FilterDropdown, {\n          tablePrefixCls: prefixCls,\n          prefixCls: `${prefixCls}-filter`,\n          dropdownPrefixCls: dropdownPrefixCls,\n          column: newColumn,\n          columnKey: columnKey,\n          filterState: filterState,\n          filterMultiple: filterMultiple,\n          filterMode: filterMode,\n          filterSearch: filterSearch,\n          triggerFilter: triggerFilter,\n          locale: locale,\n          getPopupContainer: getPopupContainer\n        }, renderColumnTitle(column.title, renderProps))\n      });\n    }\n    if ('children' in newColumn) {\n      newColumn = Object.assign(Object.assign({}, newColumn), {\n        children: injectFilter(prefixCls, dropdownPrefixCls, newColumn.children, filterStates, triggerFilter, getPopupContainer, locale, columnPos)\n      });\n    }\n    return newColumn;\n  });\n}\nexport function flattenKeys(filters) {\n  let keys = [];\n  (filters || []).forEach(_ref2 => {\n    let {\n      value,\n      children\n    } = _ref2;\n    keys.push(value);\n    if (children) {\n      keys = [].concat(_toConsumableArray(keys), _toConsumableArray(flattenKeys(children)));\n    }\n  });\n  return keys;\n}\nfunction generateFilterInfo(filterStates) {\n  const currentFilters = {};\n  filterStates.forEach(_ref3 => {\n    let {\n      key,\n      filteredKeys,\n      column\n    } = _ref3;\n    const {\n      filters,\n      filterDropdown\n    } = column;\n    if (filterDropdown) {\n      currentFilters[key] = filteredKeys || null;\n    } else if (Array.isArray(filteredKeys)) {\n      const keys = flattenKeys(filters);\n      currentFilters[key] = keys.filter(originKey => filteredKeys.includes(String(originKey)));\n    } else {\n      currentFilters[key] = null;\n    }\n  });\n  return currentFilters;\n}\nexport function getFilterData(data, filterStates) {\n  return filterStates.reduce((currentData, filterState) => {\n    const {\n      column: {\n        onFilter,\n        filters\n      },\n      filteredKeys\n    } = filterState;\n    if (onFilter && filteredKeys && filteredKeys.length) {\n      return currentData.filter(record => filteredKeys.some(key => {\n        const keys = flattenKeys(filters);\n        const keyIndex = keys.findIndex(k => String(k) === String(key));\n        const realKey = keyIndex !== -1 ? keys[keyIndex] : key;\n        return onFilter(realKey, record);\n      }));\n    }\n    return currentData;\n  }, data);\n}\nfunction useFilter(_ref4) {\n  let {\n    prefixCls,\n    dropdownPrefixCls,\n    mergedColumns,\n    onFilterChange,\n    getPopupContainer,\n    locale: tableLocale\n  } = _ref4;\n  const [filterStates, setFilterStates] = React.useState(() => collectFilterStates(mergedColumns, true));\n  const mergedFilterStates = React.useMemo(() => {\n    const collectedStates = collectFilterStates(mergedColumns, false);\n    if (collectedStates.length === 0) {\n      return collectedStates;\n    }\n    let filteredKeysIsAllNotControlled = true;\n    let filteredKeysIsAllControlled = true;\n    collectedStates.forEach(_ref5 => {\n      let {\n        filteredKeys\n      } = _ref5;\n      if (filteredKeys !== undefined) {\n        filteredKeysIsAllNotControlled = false;\n      } else {\n        filteredKeysIsAllControlled = false;\n      }\n    });\n    // Return if not controlled\n    if (filteredKeysIsAllNotControlled) {\n      // Filter column may have been removed\n      const keyList = (mergedColumns || []).map((column, index) => getColumnKey(column, getColumnPos(index)));\n      return filterStates.filter(_ref6 => {\n        let {\n          key\n        } = _ref6;\n        return keyList.includes(key);\n      }).map(item => {\n        const col = mergedColumns[keyList.findIndex(key => key === item.key)];\n        return Object.assign(Object.assign({}, item), {\n          column: Object.assign(Object.assign({}, item.column), col),\n          forceFiltered: col.filtered\n        });\n      });\n    }\n    process.env.NODE_ENV !== \"production\" ? warning(filteredKeysIsAllControlled, 'Table', 'Columns should all contain `filteredValue` or not contain `filteredValue`.') : void 0;\n    return collectedStates;\n  }, [mergedColumns, filterStates]);\n  const filters = React.useMemo(() => generateFilterInfo(mergedFilterStates), [mergedFilterStates]);\n  const triggerFilter = filterState => {\n    const newFilterStates = mergedFilterStates.filter(_ref7 => {\n      let {\n        key\n      } = _ref7;\n      return key !== filterState.key;\n    });\n    newFilterStates.push(filterState);\n    setFilterStates(newFilterStates);\n    onFilterChange(generateFilterInfo(newFilterStates), newFilterStates);\n  };\n  const transformColumns = innerColumns => injectFilter(prefixCls, dropdownPrefixCls, innerColumns, mergedFilterStates, triggerFilter, getPopupContainer, tableLocale);\n  return [transformColumns, mergedFilterStates, filters];\n}\nexport default useFilter;"],"mappings":";AAAA,OAAOA,kBAAkB,MAAM,8CAA8C;AAC7E,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,OAAO,MAAM,wBAAwB;AAC5C,SAASC,YAAY,EAAEC,YAAY,EAAE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